<?php get_header(); 

$wp_query = new WP_Query($query_string.'&posts_per_page=-1');
$gallery_settings = get_option('wpnukes_gallery_settings');
$sidebar = ($_webnukes->kvalue($gallery_settings, 'sidebar') == 'active' ) ? true : false;

if( ! is_a($wpnukes, 'wpnukes_gallery') && class_exists('wpnukes_gallery')) $wpnukes = new wpnukes_gallery;
?>

<div class="container">

	<!-- Page Banner -->
	<?php fw_subpages_banner('gallery'); /** Show Subpages banner */ ?>

	<!-- BreadCrumbs -->
	<div class="breadcrumbs">
		<?php echo get_the_breadcrumb(); /** add breadcrumbs */?>
	</div>

	<?php if($sidebar):?>
	<!-- Content Area -->
	<div id="contents_area">
		<div class="contents">
	<?php endif; ?>
	
			<?php wpnukes_gallery_header(); ?>
			<div class="<?php echo ($sidebar) ? 'gallery_area_content' : 'gallery_area_full'; ?>">
				<ul class="gallery" id="wpnukes_gallery">
					<?php 
					if(have_posts()):
					while (have_posts()) : the_post();?>
					<?php $wpnukes->gallery_html(array('container'=>null, 'thumb_size'=>'gallery-image1','title_limit'=>$_webnukes->kvalue($gallery_settings, 'title_limit', 25), 'content_limit'=>$_webnukes->kvalue($gallery_settings, 'content_limit', 200), 'show_featured'=>true)); ?>
					<?php endwhile;?>
				</ul>
				<?php else:?>
				<div class="gallery_box_single">
					<p class="not_found">
						<?php _e('Sorry - nothing to found.', 'gallery'); ?>
					</p>
				</div>
				<?php endif;?>
				<div class="pagination"></div>
				<!-- Pagination End --> 
			</div>
			
	<?php if($sidebar):?>
		</div>
	</div>
	<?php endif;?>
	
	<?php if($_webnukes->kvalue($gallery_settings, 'album_on_category') == 'active' && !$sidebar):?>
	<div class="container">
		<div id="more-galleries">
			<h2 class="blue"><?php _e('More Galleries', THEME_NAME);?></h2>
			<div id="popup" class="popup"></div>
			
			<div id="subgalleries">
				<?php $wpnukes->gallery_albums('thumbnail');?>
			</div>
		</div>
	</div>
	<?php endif;?>

	<?php if($sidebar):?>
	<div id="side_bar">
		<?php _load_dynamic_sidebar('gallery', 'blog-sidebar'); /** Display dynamic generated widgetizer sidebar */?>
	</div>
	<?php endif;?>
</div>
<?php get_footer();?>